import { hundredReg } from '@/util/zhengze';
export const columns = [
    { label: '项目名称', prop: 'projectName', disabled: true, hide: true, showColumn: false },
    { label: '产品名称', prop: 'productName', disabled: true, hide: true, showColumn: false },
    { label: '阶段名称', prop: 'phasesName', disabled: true, hide: true, showColumn: false },
    {
        label: '阶段任务名称',
        prop: 'name',
        align: 'left',
        minWidth: 300,
        disabled: true,
        hide: false,
        slot: true
    },
    {
        label: '提交物',
        prop: 'submission',
        width: 80,
        span: 12,
        display: false,
        hide: false,
    },
    {
        label: '跟踪日期',
        prop: 'trackDate',
        width: 100,
        type: 'date',
        valueFormat: 'yyyy-MM-dd',
        pickerOptions: {
            disabledDate(time) {
                // return time.getTime() + 86400000 < Date.now();
            },
        },
        rules: [
            {
                required: true,
                message: '请选择跟踪日期',
                trigger: 'change',
            },
        ],
        slot: true,
    },
    {
        label: '记录人',
        prop: 'recordName',
        width: 80,
        display: false,
    },
    {
        label: '计划进度',
        prop: 'planSpeed',
        disabled: true,
        append: '%',
        slot: true,
    },
    {
        label: '跟踪进度',
        prop: 'trackSpeed',
        width: 80,
        append: '%',
        rules: [
            {
                required: true,
                message: '请输入跟踪进度',
                trigger: 'blur',
            },
            {
                pattern: hundredReg,
                message: '跟踪进度只能是小于100的正整数或最多两位小数',
                trigger: 'blur',
            },
        ],
        slot: true,
    },
    {
        label: '任务状态',
        prop: 'taskStatus',
        type: 'select',
        width: 80,
        dicUrl: '/api/blade-system/dict-biz/dictionary?code=scheduleStatus',
        props: {
            label: 'dictValue',
            value: 'dictKey',
        },
        disabled: true,
    },
    {
        label: '风险级别',
        prop: 'riskLevel',
        type: 'select',
        width: 100,
        dicUrl: '/api/blade-system/dict-biz/dictionary?code=riskGrade',
        props: {
            label: 'dictValue',
            value: 'dictKey',
        },
        disabled: true,
    },
    {
        label: '问题分类',
        prop: 'problemCategory',
        type: 'select',
        dicData: [],
        props: {
            label: 'dictValue',
            value: 'dictKey',
        },
        rules: [],
        width: 80,
        overHidden: true,
        slot: true,
    },
    {
        label: '问题描述',
        prop: 'describes',
        width: 250,
        span: 24,
        maxlength: 100,
        type: 'textarea',
        maxRows: 2,
        showWordLimit: true,
        overHidden: true,
        rules: [],
    },
    {
        label: '问题状态',
        prop: 'problemStatus',
        type: 'select',
        dicUrl: '/api/blade-system/dict-biz/dictionary?code=problem_status',
        props: {
            label: 'dictValue',
            value: 'dictKey',
        },
        display: false,
    },
    {
        label: '跟踪状态',
        prop: 'status',
        type: 'select',
        dicUrl: '/api/blade-system/dict-biz/dictionary?code=task_track_status',
        props: {
            label: 'dictValue',
            value: 'dictKey',
        },
        slot: true,
        display: false,
    },
]
export const gridcolumns = [

    {
        label: '跟踪日期',
        prop: 'trackDate',
        width: 100,
        type: 'date',
        valueFormat: 'yyyy-MM-dd',
        pickerOptions: {
            disabledDate(time) {
                // return time.getTime() + 86400000 < Date.now();
            },
        },
        rules: [
            {
                required: true,
                message: '请选择跟踪日期',
                trigger: 'change',
            },
        ],
    },
    {
        label: '记录人',
        prop: 'recordName',
        width: 80,
        display: false,
    },
    {
        label: '计划进度',
        prop: 'planSpeed',
        disabled: true,
        append: '%',
        slot: true,
    },
    {
        label: '跟踪进度',
        prop: 'trackSpeed',
        width: 80,
        append: '%',
        rules: [
            {
                required: true,
                message: '请输入跟踪进度',
                trigger: 'blur',
            },
            {
                pattern: hundredReg,
                message: '跟踪进度只能是小于100的正整数或最多两位小数',
                trigger: 'blur',
            },
        ],
        slot: true,
    },
    {
        label: '任务状态',
        prop: 'taskStatus',
        type: 'select',
        width: 80,
        dicUrl: '/api/blade-system/dict-biz/dictionary?code=scheduleStatus',
        props: {
            label: 'dictValue',
            value: 'dictKey',
        },
        disabled: true,
    },
    {
        label: '风险级别',
        prop: 'riskLevel',
        type: 'select',
        width: 100,
        dicUrl: '/api/blade-system/dict-biz/dictionary?code=riskGrade',
        props: {
            label: 'dictValue',
            value: 'dictKey',
        },
        disabled: true,
    },
    {
        label: '问题分类',
        prop: 'problemCategory',
        type: 'select',
        dicData: [],
        props: {
            label: 'dictValue',
            value: 'dictKey',
        },
        rules: [],
        width: 80,
        overHidden: true,
        slot: true,
    },
    {
        label: '问题描述',
        prop: 'describes',
        width: 250,
        span: 24,
        maxlength: 50,
        type: 'textarea',
        maxRows: 2,
        showWordLimit: true,
        overHidden: true,
        rules: [],
    },
    {
        label: '问题状态',
        prop: 'problemStatus',
        type: 'select',
        dicUrl: '/api/blade-system/dict-biz/dictionary?code=problem_status',
        props: {
            label: 'dictValue',
            value: 'dictKey',
        },
        display: false,
    },
    {
        label: '跟踪状态',
        prop: 'status',
        type: 'select',
        dicUrl: '/api/blade-system/dict-biz/dictionary?code=task_track_status',
        props: {
            label: 'dictValue',
            value: 'dictKey',
        },
        slot: true,
        display: false,
    },
]